<?
$subject_id=$_GET['m'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>แก้ไขข้อมูลรายวิชา</title>
<style type="text/css">
.body {
}

#boxstye{
	height: auto;
	width: 760px;
	background-color: #444041;
}
body,td,th {
	font-size: 14px;
	color: #FFF;
}
</style>
</head>
<body>

<div id="boxstye">

<?
$sql_edit = "select * from tb_subject where subject_id = '$subject_id' ";
$result_edit = $dbfunc->query($sql_edit);
//ดึงข้อมูลแบบอาร์เรย์  โดยเลือกแสดงแค่เรคคอร์ดเดียว (ไม่ใช้ while)
$fetch = mysql_fetch_array($result_edit);  
?>


<form action="?module=admin&amp;page=update_subject" method="post" enctype="multipart/form-data" name="frm_subject" id="frm_subject">
    <input type="hidden" name="old_id" value="<?php echo $subject_id; ?>" />
    <table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <th colspan="3" align="center">&nbsp;</th>
    </tr>
    <tr>
      <th height="35" colspan="3" align="center" bgcolor="#999999">แก้ไขข้อมูลรายวิชา<br /></th>
    </tr>
    <tr>
      <td width="340" height="35" align="right" bgcolor="#999999"><span class="style_1">รหัสวิชา</span></td>
      <td width="7" height="35" bgcolor="#999999">:</td>
      <td width="523" height="35" bgcolor="#999999"><span class="style_1">
        <input name="subject_id" type="text" id="subject_id" size="20" maxlength="40" value="<? echo $fetch['subject_id'] ?>" />
      </span></td>
    <tr>
      <td width="340" height="35" align="right" bgcolor="#999999"><span class="style_1">ชื่อวิชา</span></td>
      <td width="7" height="35" bgcolor="#999999">:</td>
      <td width="523" height="35" bgcolor="#999999"><span class="style_1">
        <input name="subject_name" type="text" id="subject_name" size="20" maxlength="40" value="<? echo $fetch['subject_name'] ?>" />
        
      </span></td>
    </tr>
    <tr>
      <td height="35" align="right" bgcolor="#999999"><span class="style_1">คำอธิบายรายวิชา</span></td>
      <td height="35" bgcolor="#999999">:</td>
      <td height="35" bgcolor="#999999"><a id="frm_detail-botton" style="cursor:pointer;">แก้ไขคำอธิบายรายวิชา</a><textarea name="subject_detail" id="subject_detail" cols="60" rows="30" style="display:none;"><?php echo $fetch['subject_detail']; ?></textarea></td>
    </tr> 
    
    <tr>
      <td height="35" bgcolor="#999999">&nbsp;</td>
      <td height="35" bgcolor="#999999">&nbsp;</td>
      <td height="40" bgcolor="#999999"><span class="style_1">
        <input type="submit" name="Submit" id="Submit" value=" บันทึก  " />
      </span></td>
    </tr>
    <tr>
      <td bgcolor="#999999">&nbsp;</td>
      <td bgcolor="#999999">&nbsp;</td>
      <td bgcolor="#999999">&nbsp;</td>
    </tr>
  </table>
</form>
</div>
<script>
$(function(){
	$("#frm_detail-botton").one('click',function(event){
		event.preventDefault();
		$(this).slideUp();
		$("textarea[name=subject_detail]").slideDown();
		return false;
	});
});
</script>
</body>
</html>


